Subject: Re: quick question
From: "SIMONC%MARS.decnet"@mcs.co.uk (Simon Champion - [email-masked])
To: [email-masked]
Date: Fri, 7 Nov 1997 18:03 GMT

>From:	MCSDEV::SMTP%"[email-masked]"      "Matt Ward"  7-NOV-1997 15:05:27.84
>To:	Amos-List <[email-masked]>
>Subj:	a quick question

>Hi all!
>Anyone got anyideas on this one:

>I want to use a three character string eg "ADC" or something.
>Now suppose I want to change one character to "E" by removing the
>lowest in this case "A". Is there a way of doing this quickly (ie in
>one line) , no matter where the lowest is?

>Or I could do it that I keep adding letters to the string and then I
>need a fast (very) way of picking out the highest 3 letters. Any
>ideas???

--------------------------------------

You need to use Asc() to get the ASCII values of each character, and
compare them.

Try something like this:
(this routine should work for any length of string)

    For COUNT=1 to Len(THE_STRING)-1
        If Asc(Mid$(THE_STRING,COUNT,1))>HIGHEST Then HIGHEST=COUNT
    Next

In some other languages, it's much easier than this. Amos may have it's
good points, but it can't do everything the easiest way  :-}

That's all for now....

     Simon Champion.

-------------------------------------------------------------------------------
"If in doubt... blame it on Simon  :-( "